﻿
module.exports = app => {
  const co = require('co');
  app.mysql.get = co.wrap(app.mysql.get);
  app.mysql.insert = co.wrap(app.mysql.insert);

  return class users extends app.Service {
    async find(row) {
      // 假如 我们拿到用户 id 从数据库获取用户详细信息
      const dbs = await app.mysql.get('users', row);
      return dbs;
    }

    async insert(row) {
      const db = await app.mysql.insert('users',row);
      return db;
    }
   
  }
};
